home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / global-one-water.swf / scripts / DefineSprite_17 / frame_10 / DoAction.as
Encoding:
Text File  |  2011-10-17  |  1.3 KB  |  76 lines

  1. function onEnterFrame()
  2. {
  3.    var _loc2_ = _root.getBytesLoaded() / _root.getBytesTotal();
  4.    if(getTimer() >= startTime + 100)
  5.    {
  6.       animDone = true;
  7.    }
  8.    if(Math.ceil(bar._width) >= width && animDone)
  9.    {
  10.       trace("loaded!");
  11.       stopSparks = true;
  12.       delete onEnterFrame;
  13.       gotoAndStop("out");
  14.       play();
  15.    }
  16.    else
  17.    {
  18.       setProgress(_loc2_);
  19.    }
  20. }
  21. function fadeOut()
  22. {
  23.    setProgress(progress);
  24.    this._alpha -= 5;
  25.    if(this._alpha <= -50)
  26.    {
  27.       this._visible = false;
  28.       _parent.play();
  29.    }
  30. }
  31. function makeSpark()
  32. {
  33. }
  34. function sparkControl()
  35. {
  36.    if(!stopSparks)
  37.    {
  38.       this._y += this.grav;
  39.       this._x += this.wind;
  40.       this.grav *= gravity;
  41.       this._alpha -= this.grav;
  42.       this._rotation += this.spin;
  43.       if(this._alpha <= 0)
  44.       {
  45.          this.removeMovieClip();
  46.       }
  47.    }
  48.    else
  49.    {
  50.       this.removeMovieClip();
  51.    }
  52. }
  53. function setProgress(p)
  54. {
  55.    bar._width = (bar._width * 2 + p * width) / 3;
  56.    if(progress != 1)
  57.    {
  58.       makeSpark();
  59.    }
  60. }
  61. width = 200;
  62. i = 0;
  63. gravity = 1.3;
  64. animDone = true;
  65. startTime = getTimer();
  66. stop();
  67. if(this._name == "loader_mc")
  68. {
  69.    myName = _global.language.loadingAssets;
  70. }
  71. else
  72. {
  73.    myName = _global.language.initLevel;
  74. }
  75. setProgress(0);
  76.